﻿using FunArts.EasyDevOps.Shared.Models.SshClient.NginxClient;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FunArts.EasyDevOps.Rcl.Service
{
    /// <summary>
    /// Nginx管理服务
    /// </summary>
    public interface IRemoteNginxService
    {
        public virtual string NginxConfigBasePath => "/etc/nginx/conf.d";
        /// <summary>
        /// 获取当前配置
        /// </summary>
        /// <param name="configPath"></param>
        /// <returns></returns>
        NginxServerConfig GetCurrentConfig(string configPath = "/etc/nginx/conf.d/default");
        /// <summary>
        /// 更新配置
        /// </summary>
        /// <param name="config"></param>
        /// <param name="configPath"></param>
        /// <param name="progressCallback"></param>
        /// <returns></returns>
        Task UpdateConfig(NginxServerConfig config, string configPath = "/etc/nginx/conf.d/default", Action<double> progressCallback = null);
    }
}
